﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace WP8.NavigationFramework.Views
{
    public partial class Registro : PhoneApplicationPage
    {
        public Registro()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (this.NavigationContext.QueryString.ContainsKey("Fecha"))
                this.txbFechaRegistro.Text = this.NavigationContext.QueryString["Fecha"];
            else
                this.txbFechaRegistro.Text = "No tenemos fecha :(";

            if (this.NavigationContext.QueryString.ContainsKey("NroRegistros"))
                this.txbNroRegistros.Text = this.NavigationContext.QueryString["NroRegistros"];
            else
                this.txbNroRegistros.Text = "0";

            base.OnNavigatedTo(e);
        }


        private void btnVolver_Click(object sender, RoutedEventArgs e)
        {
            if (this.NavigationService.CanGoBack)
                this.NavigationService.GoBack();
        }
    }
}